package cn.edu.scau.cmi.luochenghao.chapter06;

class Animal {
	void cry() {
		
	}
}

class Dog extends Animal {
	void cry() {
		System.out.println("汪汪.....");
	}
}

class Cat extends Animal {
	void cry() {
		System.out.println("喵喵.....");
	}
}

public class Example6_8 {

	public static void main(String[] args) {
		Animal animal;
		animal=new Dog();
		animal.cry();
		animal=new Cat();
		animal.cry();

	}

}
